<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/7/28
 * Time: 11:23
 */

namespace app\api\controller;

use think\Db;
use think\Request;
use think\controller;

class WebInfo extends Rest
{
    public function index()
    {

        if(1 != self::check_power(1)){
            return $this->data;
        }
        if ($this->user_type == 'admin') {

        }
        if ($this->user_type == 'user') {
            $dataresult = Db::name("webinfo")->select();
        }
        $data = ['msg' => "获取成功", "code" => 1, "data" =>$dataresult];
        return $data;
    }

    public function getNav()
    {
        if (1 != self::check_power(1)) {
            return $this->data;
        }
        if ($this->user_type == 'admin') {

        }
        if ($this->user_type == 'user') {
            $dataresult = Db::name("nav")->where(["data_state"=>1])->select();
        }
        $this->data['code'] = 1;
        $this->data['msg']  = '获取成功';
        $this->data['data'] = $dataresult;
        return $this->data;
    }
}


